home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / Delphi 3.0 / DATA.Z / STRGIMPL.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-01-30  |  9.0 KB  |  352 lines

  1. unit StrGImpl;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, ActiveX, Classes, Controls, Graphics, Menus, Forms, StdCtrls,
  7.   ComServ, StdVCL, AXCtrls, DelLib, Grids;
  8.  
  9. type
  10.   TStringGridX = class(TActiveXControl, IStringGridX)
  11.   private
  12.     { Private declarations }
  13.     FDelphiControl: TStringGrid;
  14.     FEvents: IStringGridXEvents;
  15.   protected
  16.     { Protected declarations }
  17.     procedure InitializeControl; override;
  18.     procedure EventSinkChanged(const EventSink: IUnknown); override;
  19.     procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override;
  20.     function Get_Col: Integer; safecall;
  21.     function Get_ColCount: Integer; safecall;
  22.     function Get_Color: TColor; safecall;
  23.     function Get_Ctl3D: WordBool; safecall;
  24.     function Get_Cursor: Smallint; safecall;
  25.     function Get_DefaultColWidth: Integer; safecall;
  26.     function Get_DefaultDrawing: WordBool; safecall;
  27.     function Get_DefaultRowHeight: Integer; safecall;
  28.     function Get_DragCursor: Smallint; safecall;
  29.     function Get_EditorMode: WordBool; safecall;
  30.     function Get_Enabled: WordBool; safecall;
  31.     function Get_FixedColor: TColor; safecall;
  32.     function Get_FixedCols: Integer; safecall;
  33.     function Get_FixedRows: Integer; safecall;
  34.     function Get_Font: Font; safecall;
  35.     function Get_GridHeight: Integer; safecall;
  36.     function Get_GridLineWidth: Integer; safecall;
  37.     function Get_GridWidth: Integer; safecall;
  38.     function Get_LeftCol: Integer; safecall;
  39.     function Get_ParentColor: WordBool; safecall;
  40.     function Get_Row: Integer; safecall;
  41.     function Get_RowCount: Integer; safecall;
  42.     function Get_TopRow: Integer; safecall;
  43.     function Get_Visible: WordBool; safecall;
  44.     function Get_VisibleColCount: Integer; safecall;
  45.     function Get_VisibleRowCount: Integer; safecall;
  46.     procedure AboutBox; safecall;
  47.     procedure MouseToCell(X, Y: Integer; var ACol, ARow: Integer); safecall;
  48.     procedure Set_Col(Value: Integer); safecall;
  49.     procedure Set_ColCount(Value: Integer); safecall;
  50.     procedure Set_Color(Value: TColor); safecall;
  51.     procedure Set_Ctl3D(Value: WordBool); safecall;
  52.     procedure Set_Cursor(Value: Smallint); safecall;
  53.     procedure Set_DefaultColWidth(Value: Integer); safecall;
  54.     procedure Set_DefaultDrawing(Value: WordBool); safecall;
  55.     procedure Set_DefaultRowHeight(Value: Integer); safecall;
  56.     procedure Set_DragCursor(Value: Smallint); safecall;
  57.     procedure Set_EditorMode(Value: WordBool); safecall;
  58.     procedure Set_Enabled(Value: WordBool); safecall;
  59.     procedure Set_FixedColor(Value: TColor); safecall;
  60.     procedure Set_FixedCols(Value: Integer); safecall;
  61.     procedure Set_FixedRows(Value: Integer); safecall;
  62.     procedure Set_Font(const Value: Font); safecall;
  63.     procedure Set_GridLineWidth(Value: Integer); safecall;
  64.     procedure Set_LeftCol(Value: Integer); safecall;
  65.     procedure Set_ParentColor(Value: WordBool); safecall;
  66.     procedure Set_Row(Value: Integer); safecall;
  67.     procedure Set_RowCount(Value: Integer); safecall;
  68.     procedure Set_TopRow(Value: Integer); safecall;
  69.     procedure Set_Visible(Value: WordBool); safecall;
  70.   end;
  71.  
  72. implementation
  73. uses StringGP;
  74. { TStringGridX }
  75.  
  76. procedure TStringGridX.InitializeControl;
  77. begin
  78.   FDelphiControl := Control as TStringGrid;
  79. end;
  80.  
  81. procedure TStringGridX.EventSinkChanged(const EventSink: IUnknown);
  82. begin
  83.   FEvents := EventSink as IStringGridXEvents;
  84. end;
  85.  
  86. procedure TStringGridX.DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage);
  87. begin
  88.   { Define property pages here.  Property pages are defined by calling
  89.     DefinePropertyPage with the class id of the page.  For example,
  90.       DefinePropertyPage(Class_StringGridXPage); }
  91. end;
  92.  
  93. function TStringGridX.Get_Col: Integer;
  94. begin
  95.   Result := FDelphiControl.Col;
  96. end;
  97.  
  98. function TStringGridX.Get_ColCount: Integer;
  99. begin
  100.   Result := FDelphiControl.ColCount;
  101. end;
  102.  
  103. function TStringGridX.Get_Color: TColor;
  104. begin
  105.   Result := FDelphiControl.Color;
  106. end;
  107.  
  108. function TStringGridX.Get_Ctl3D: WordBool;
  109. begin
  110.   Result := FDelphiControl.Ctl3D;
  111. end;
  112.  
  113. function TStringGridX.Get_Cursor: Smallint;
  114. begin
  115.   Result := Smallint(FDelphiControl.Cursor);
  116. end;
  117.  
  118. function TStringGridX.Get_DefaultColWidth: Integer;
  119. begin
  120.   Result := FDelphiControl.DefaultColWidth;
  121. end;
  122.  
  123. function TStringGridX.Get_DefaultDrawing: WordBool;
  124. begin
  125.   Result := FDelphiControl.DefaultDrawing;
  126. end;
  127.  
  128. function TStringGridX.Get_DefaultRowHeight: Integer;
  129. begin
  130.   Result := FDelphiControl.DefaultRowHeight;
  131. end;
  132.  
  133. function TStringGridX.Get_DragCursor: Smallint;
  134. begin
  135.   Result := Smallint(FDelphiControl.DragCursor);
  136. end;
  137.  
  138. function TStringGridX.Get_EditorMode: WordBool;
  139. begin
  140.   Result := FDelphiControl.EditorMode;
  141. end;
  142.  
  143. function TStringGridX.Get_Enabled: WordBool;
  144. begin
  145.   Result := FDelphiControl.Enabled;
  146. end;
  147.  
  148. function TStringGridX.Get_FixedColor: TColor;
  149. begin
  150.   Result := FDelphiControl.FixedColor;
  151. end;
  152.  
  153. function TStringGridX.Get_FixedCols: Integer;
  154. begin
  155.   Result := FDelphiControl.FixedCols;
  156. end;
  157.  
  158. function TStringGridX.Get_FixedRows: Integer;
  159. begin
  160.   Result := FDelphiControl.FixedRows;
  161. end;
  162.  
  163. function TStringGridX.Get_Font: Font;
  164. begin
  165.   GetOleFont(FDelphiControl.Font, Result);
  166. end;
  167.  
  168. function TStringGridX.Get_GridHeight: Integer;
  169. begin
  170.   Result := FDelphiControl.GridHeight;
  171. end;
  172.  
  173. function TStringGridX.Get_GridLineWidth: Integer;
  174. begin
  175.   Result := FDelphiControl.GridLineWidth;
  176. end;
  177.  
  178. function TStringGridX.Get_GridWidth: Integer;
  179. begin
  180.   Result := FDelphiControl.GridWidth;
  181. end;
  182.  
  183. function TStringGridX.Get_LeftCol: Integer;
  184. begin
  185.   Result := FDelphiControl.LeftCol;
  186. end;
  187.  
  188. function TStringGridX.Get_ParentColor: WordBool;
  189. begin
  190.   Result := FDelphiControl.ParentColor;
  191. end;
  192.  
  193. function TStringGridX.Get_Row: Integer;
  194. begin
  195.   Result := FDelphiControl.Row;
  196. end;
  197.  
  198. function TStringGridX.Get_RowCount: Integer;
  199. begin
  200.   Result := FDelphiControl.RowCount;
  201. end;
  202.  
  203. function TStringGridX.Get_TopRow: Integer;
  204. begin
  205.   Result := FDelphiControl.TopRow;
  206. end;
  207.  
  208. function TStringGridX.Get_Visible: WordBool;
  209. begin
  210.   Result := FDelphiControl.Visible;
  211. end;
  212.  
  213. function TStringGridX.Get_VisibleColCount: Integer;
  214. begin
  215.   Result := FDelphiControl.VisibleColCount;
  216. end;
  217.  
  218. function TStringGridX.Get_VisibleRowCount: Integer;
  219. begin
  220.   Result := FDelphiControl.VisibleRowCount;
  221. end;
  222.  
  223. procedure TStringGridX.AboutBox;
  224. begin
  225.   ShowStringGridXAbout;
  226. end;
  227.  
  228. procedure TStringGridX.MouseToCell(X, Y: Integer; var ACol, ARow: Integer);
  229. begin
  230.  
  231. end;
  232.  
  233. procedure TStringGridX.Set_Col(Value: Integer);
  234. begin
  235.   FDelphiControl.Col := Value;
  236. end;
  237.  
  238. procedure TStringGridX.Set_ColCount(Value: Integer);
  239. begin
  240.   FDelphiControl.ColCount := Value;
  241. end;
  242.  
  243. procedure TStringGridX.Set_Color(Value: TColor);
  244. begin
  245.   FDelphiControl.Color := Value;
  246. end;
  247.  
  248. procedure TStringGridX.Set_Ctl3D(Value: WordBool);
  249. begin
  250.   FDelphiControl.Ctl3D := Value;
  251. end;
  252.  
  253. procedure TStringGridX.Set_Cursor(Value: Smallint);
  254. begin
  255.   FDelphiControl.Cursor := TCursor(Value);
  256. end;
  257.  
  258. procedure TStringGridX.Set_DefaultColWidth(Value: Integer);
  259. begin
  260.   FDelphiControl.DefaultColWidth := Value;
  261. end;
  262.  
  263. procedure TStringGridX.Set_DefaultDrawing(Value: WordBool);
  264. begin
  265.   FDelphiControl.DefaultDrawing := Value;
  266. end;
  267.  
  268. procedure TStringGridX.Set_DefaultRowHeight(Value: Integer);
  269. begin
  270.   FDelphiControl.DefaultRowHeight := Value;
  271. end;
  272.  
  273. procedure TStringGridX.Set_DragCursor(Value: Smallint);
  274. begin
  275.   FDelphiControl.DragCursor := TCursor(Value);
  276. end;
  277.  
  278. procedure TStringGridX.Set_EditorMode(Value: WordBool);
  279. begin
  280.   FDelphiControl.EditorMode := Value;
  281. end;
  282.  
  283. procedure TStringGridX.Set_Enabled(Value: WordBool);
  284. begin
  285.   FDelphiControl.Enabled := Value;
  286. end;
  287.  
  288. procedure TStringGridX.Set_FixedColor(Value: TColor);
  289. begin
  290.   FDelphiControl.FixedColor := Value;
  291. end;
  292.  
  293. procedure TStringGridX.Set_FixedCols(Value: Integer);
  294. begin
  295.   FDelphiControl.FixedCols := Value;
  296. end;
  297.  
  298. procedure TStringGridX.Set_FixedRows(Value: Integer);
  299. begin
  300.   FDelphiControl.FixedRows := Value;
  301. end;
  302.  
  303. procedure TStringGridX.Set_Font(const Value: Font);
  304. begin
  305.   SetOleFont(FDelphiControl.Font, Value);
  306. end;
  307.  
  308. procedure TStringGridX.Set_GridLineWidth(Value: Integer);
  309. begin
  310.   FDelphiControl.GridLineWidth := Value;
  311. end;
  312.  
  313. procedure TStringGridX.Set_LeftCol(Value: Integer);
  314. begin
  315.   FDelphiControl.LeftCol := Value;
  316. end;
  317.  
  318. procedure TStringGridX.Set_ParentColor(Value: WordBool);
  319. begin
  320.   FDelphiControl.ParentColor := Value;
  321. end;
  322.  
  323. procedure TStringGridX.Set_Row(Value: Integer);
  324. begin
  325.   FDelphiControl.Row := Value;
  326. end;
  327.  
  328. procedure TStringGridX.Set_RowCount(Value: Integer);
  329. begin
  330.   FDelphiControl.RowCount := Value;
  331. end;
  332.  
  333. procedure TStringGridX.Set_TopRow(Value: Integer);
  334. begin
  335.   FDelphiControl.TopRow := Value;
  336. end;
  337.  
  338. procedure TStringGridX.Set_Visible(Value: WordBool);
  339. begin
  340.   FDelphiControl.Visible := Value;
  341. end;
  342.  
  343. initialization
  344.   TActiveXControlFactory.Create(
  345.     ComServer,
  346.     TStringGridX,
  347.     TStringGrid,
  348.     Class_StringGridX,
  349.     24,
  350.     '{5A5659CD-7975-11D0-BE02-00A024D1875C}');
  351. end.
  352.